<template>
	<!-- 垂直商品项 -->
	<view class="guess-section">
		<view v-for="(item, index) in list" :key="index" class="guess-item">
			<view class="image-wrapper">
				<image :src="$api.uploadImage+item.goods_image" mode="aspectFill"></image>
			</view>
			<view style="width: 90%;margin: 0 auto;">
				<view class="title clamp">{{item.goods_name}}</view>
				<view class="kind">{{'克数：'+item.grammage}}</view>
				<view class="bottom-view">
					<view class="price"><text style="font-size: 18rpx;">￥</text>{{item.goods_price}}</view>
					<view class="price-bottom" @click="$emit('navigatorHomeInfo',item.id)">
						{{buttonText}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props:{
			list:Array,
			buttonText:String
		}
	}
</script>

<style lang="less">
	.guess-section {
		display: flex;
		flex-wrap: wrap;
		padding: 0 20rpx 20rpx 20rpx;
		line-height: 1.4;
	
		.guess-item {
			display: flex;
			flex-direction: column;
			width: 48%;
			margin-top: 20rpx;
			padding-bottom: 20rpx;
			background: #fff;
			border-radius: 20rpx;
	
			&:nth-child(2n+1) {
				margin-right: 4%;
			}
		}
	
		.image-wrapper {
			width: 100%;
			height: 330rpx;
			border-top-left-radius: 20rpx;
			border-top-right-radius: 20rpx;
			overflow: hidden;
	
			image {
				width: 100%;
				height: 100%;
				opacity: 1;
			}
		}
	
		.title {
			font-size: 26rpx;
			color: #333;
			margin: 5rpx 0rpx;
		}
	
		.kind {
			font-size: 24rpx;
			color: #999999;
		}
	
		.price {
			font-size: 17px;
			color: #E83434;
		}
	}
	
	.grid_src {
		width: 100rpx;
		margin-bottom: 10rpx;
	}
	
	.grid-text {
		font-size: 26rpx;
		color: #333;
	}
	
	.wrap {
		.wrap-view {
			padding: 40rpx;
			background: linear-gradient(180deg, #2776F6 0%, rgba(51, 120, 231, 0.00) 94%);
			background-blend-mode: multiply;
		}
	
		.bottom-view {
			display: flex;
			align-items: center;
			justify-content: space-between;
	
			.price-bottom {
				display: flex;
				align-items: center;
				justify-content: center;
				padding: 10rpx 15rpx;
				font-size: 13rpx;
				background: #2776F6;
				color: #ffffff;
				border-radius: 35rpx;
			}
		}
	}
</style>